#!/usr/bin/python
# -*- coding:utf-8 -*-
from flask import g

from app import create_app
from app.database.models import User

config_name = 'production'
app = create_app(config_name)


@app.before_request
def before_request():
    if not getattr(g, 'default_user', None):
        g.default_user = User.query.get(1)


if __name__ == '__main__':
    app.logger.info('app run...')
    app.run()